home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_automake.idb / usr / freeware / info / automake.info-2.z / automake.info-2
Encoding:
GNU Info File  |  1999-07-16  |  48.4 KB  |  1,264 lines

  1. This is automake.info, produced by Makeinfo version 3.12b from
  2. automake.texi.
  3.  
  4. INFO-DIR-SECTION GNU admin
  5. START-INFO-DIR-ENTRY
  6. * automake: (automake).        Making Makefile.in's
  7. END-INFO-DIR-ENTRY
  8.  
  9. INFO-DIR-SECTION Individual utilities
  10. START-INFO-DIR-ENTRY
  11. * aclocal: (automake)Invoking aclocal.          Generating aclocal.m4
  12. END-INFO-DIR-ENTRY
  13.  
  14.    This file documents GNU automake 1.4
  15.  
  16.    Copyright (C) 1995, 96, 97, 98 Free Software Foundation, Inc.
  17.  
  18.    Permission is granted to make and distribute verbatim copies of this
  19. manual provided the copyright notice and this permission notice are
  20. preserved on all copies.
  21.  
  22.    Permission is granted to copy and distribute modified versions of
  23. this manual under the conditions for verbatim copying, provided that
  24. the entire resulting derived work is distributed under the terms of a
  25. permission notice identical to this one.
  26.  
  27.    Permission is granted to copy and distribute translations of this
  28. manual into another language, under the above conditions for modified
  29. versions, except that this permission notice may be stated in a
  30. translation approved by the Foundation.
  31.  
  32. 
  33. File: automake.info,  Node: A Shared Library,  Next: Program variables,  Prev: LIBOBJS,  Up: Programs
  34.  
  35. Building a Shared Library
  36. =========================
  37.  
  38.    Building shared libraries is a relatively complex matter.  For this
  39. reason, GNU Libtool (*note Introduction: (libtool)Top.) was created to
  40. help build shared libraries in a platform-independent way.
  41.  
  42.    Automake uses Libtool to build libraries declared with the
  43. `LTLIBRARIES' primary.  Each `_LTLIBRARIES' variable is a list of
  44. shared libraries to build.  For instance, to create a library named
  45. `libgettext.a' and its corresponding shared libraries, and install them
  46. in `libdir', write:
  47.  
  48.      lib_LTLIBRARIES = libgettext.la
  49.  
  50.    Note that shared libraries _must_ be installed, so
  51. `check_LTLIBRARIES' is not allowed.  However, `noinst_LTLIBRARIES' is
  52. allowed.  This feature should be used for libtool "convenience
  53. libraries".
  54.  
  55.    For each library, the `LIBRARY_LIBADD' variable contains the names
  56. of extra libtool objects (`.lo' files) to add to the shared library.
  57. The `LIBRARY_LDFLAGS' variable contains any additional libtool flags,
  58. such as `-version-info' or `-static'.
  59.  
  60.    Where an ordinary library might include `@LIBOBJS@', a libtool
  61. library must use `@LTLIBOBJS@'.  This is required because the object
  62. files that libtool operates on do not necessarily end in `.o'.  The
  63. libtool manual contains more details on this topic.
  64.  
  65.    For libraries installed in some directory, Automake will
  66. automatically supply the appropriate `-rpath' option.  However, for
  67. libraries determined at configure time (and thus mentioned in
  68. `EXTRA_LTLIBRARIES'), Automake does not know the eventual installation
  69. directory; for such libraries you must add the `-rpath' option to the
  70. appropriate `_LDFLAGS' variable by hand.
  71.  
  72.    *Note Using Automake with Libtool: (libtool)Using Automake, for more
  73. information.
  74.  
  75. 
  76. File: automake.info,  Node: Program variables,  Next: Yacc and Lex,  Prev: A Shared Library,  Up: Programs
  77.  
  78. Variables used when building a program
  79. ======================================
  80.  
  81.    Occasionally it is useful to know which `Makefile' variables
  82. Automake uses for compilations; for instance you might need to do your
  83. own compilation in some special cases.
  84.  
  85.    Some variables are inherited from Autoconf; these are `CC',
  86. `CFLAGS', `CPPFLAGS', `DEFS', `LDFLAGS', and `LIBS'.
  87.  
  88.    There are some additional variables which Automake itself defines:
  89.  
  90. `INCLUDES'
  91.      A list of `-I' options.  This can be set in your `Makefile.am' if
  92.      you have special directories you want to look in.  Automake already
  93.      provides some `-I' options automatically.  In particular it
  94.      generates `-I$(srcdir)' and a `-I' pointing to the directory
  95.      holding `config.h' (if you've used `AC_CONFIG_HEADER' or
  96.      `AM_CONFIG_HEADER').
  97.  
  98.      `INCLUDES' can actually be used for other `cpp' options besides
  99.      `-I'.  For instance, it is sometimes used to pass arbitrary `-D'
  100.      options to the compiler.
  101.  
  102. `COMPILE'
  103.      This is the command used to actually compile a C source file.  The
  104.      filename is appended to form the complete command line.
  105.  
  106. `LINK'
  107.      This is the command used to actually link a C program.
  108.  
  109. 
  110. File: automake.info,  Node: Yacc and Lex,  Next: C++ Support,  Prev: Program variables,  Up: Programs
  111.  
  112. Yacc and Lex support
  113. ====================
  114.  
  115.    Automake has somewhat idiosyncratic support for Yacc and Lex.
  116.  
  117.    Automake assumes that the `.c' file generated by `yacc' (or `lex')
  118. should be named using the basename of the input file.  That is, for a
  119. yacc source file `foo.y', Automake will cause the intermediate file to
  120. be named `foo.c' (as opposed to `y.tab.c', which is more traditional).
  121.  
  122.    The extension of a yacc source file is used to determine the
  123. extension of the resulting `C' or `C++' file.  Files with the extension
  124. `.y' will be turned into `.c' files; likewise, `.yy' will become `.cc';
  125. `.y++', `c++'; and `.yxx', `.cxx'.
  126.  
  127.    Likewise, lex source files can be used to generate `C' or `C++'; the
  128. extensions `.l', `.ll', `.l++', and `.lxx' are recognized.
  129.  
  130.    You should never explicitly mention the intermediate (`C' or `C++')
  131. file in any `SOURCES' variable; only list the source file.
  132.  
  133.    The intermediate files generated by `yacc' (or `lex') will be
  134. included in any distribution that is made.  That way the user doesn't
  135. need to have `yacc' or `lex'.
  136.  
  137.    If a `yacc' source file is seen, then your `configure.in' must
  138. define the variable `YACC'.  This is most easily done by invoking the
  139. macro `AC_PROG_YACC' (*note Particular Program Checks:
  140. (autoconf)Particular Programs.).
  141.  
  142.    Similarly, if a `lex' source file is seen, then your `configure.in'
  143. must define the variable `LEX'.  You can use `AC_PROG_LEX' to do this
  144. (*note Particular Program Checks: (autoconf)Particular Programs.).
  145. Automake's `lex' support also requires that you use the `AC_DECL_YYTEXT'
  146. macro--automake needs to know the value of `LEX_OUTPUT_ROOT'.  This is
  147. all handled for you if you use the `AM_PROG_LEX' macro (*note
  148. Macros::.).
  149.  
  150.    Automake makes it possible to include multiple `yacc' (or `lex')
  151. source files in a single program.  Automake uses a small program called
  152. `ylwrap' to run `yacc' (or `lex') in a subdirectory.  This is necessary
  153. because yacc's output filename is fixed, and a parallel make could
  154. conceivably invoke more than one instance of `yacc' simultaneously.
  155. The `ylwrap' program is distributed with Automake.  It should appear in
  156. the directory specified by `AC_CONFIG_AUX_DIR' (*note Finding
  157. `configure' Input: (autoconf)Input.), or the current directory if that
  158. macro is not used in `configure.in'.
  159.  
  160.    For `yacc', simply managing locking is insufficient.  The output of
  161. `yacc' always uses the same symbol names internally, so it isn't
  162. possible to link two `yacc' parsers into the same executable.
  163.  
  164.    We recommend using the following renaming hack used in `gdb':
  165.      #define    yymaxdepth c_maxdepth
  166.      #define    yyparse    c_parse
  167.      #define    yylex    c_lex
  168.      #define    yyerror    c_error
  169.      #define    yylval    c_lval
  170.      #define    yychar    c_char
  171.      #define    yydebug    c_debug
  172.      #define    yypact    c_pact
  173.      #define    yyr1    c_r1
  174.      #define    yyr2    c_r2
  175.      #define    yydef    c_def
  176.      #define    yychk    c_chk
  177.      #define    yypgo    c_pgo
  178.      #define    yyact    c_act
  179.      #define    yyexca    c_exca
  180.      #define yyerrflag c_errflag
  181.      #define yynerrs    c_nerrs
  182.      #define    yyps    c_ps
  183.      #define    yypv    c_pv
  184.      #define    yys    c_s
  185.      #define    yy_yys    c_yys
  186.      #define    yystate    c_state
  187.      #define    yytmp    c_tmp
  188.      #define    yyv    c_v
  189.      #define    yy_yyv    c_yyv
  190.      #define    yyval    c_val
  191.      #define    yylloc    c_lloc
  192.      #define yyreds    c_reds
  193.      #define yytoks    c_toks
  194.      #define yylhs    c_yylhs
  195.      #define yylen    c_yylen
  196.      #define yydefred c_yydefred
  197.      #define yydgoto    c_yydgoto
  198.      #define yysindex c_yysindex
  199.      #define yyrindex c_yyrindex
  200.      #define yygindex c_yygindex
  201.      #define yytable     c_yytable
  202.      #define yycheck     c_yycheck
  203.      #define yyname   c_yyname
  204.      #define yyrule   c_yyrule
  205.  
  206.    For each define, replace the `c_' prefix with whatever you like.
  207. These defines work for `bison', `byacc', and traditional `yacc's.  If
  208. you find a parser generator that uses a symbol not covered here, please
  209. report the new name so it can be added to the list.
  210.  
  211. 
  212. File: automake.info,  Node: C++ Support,  Next: Fortran 77 Support,  Prev: Yacc and Lex,  Up: Programs
  213.  
  214. C++ Support
  215. ===========
  216.  
  217.    Automake includes full support for C++.
  218.  
  219.    Any package including C++ code must define the output variable `CXX'
  220. in `configure.in'; the simplest way to do this is to use the
  221. `AC_PROG_CXX' macro (*note Particular Program Checks:
  222. (autoconf)Particular Programs.).
  223.  
  224.    A few additional variables are defined when a C++ source file is
  225. seen:
  226.  
  227. `CXX'
  228.      The name of the C++ compiler.
  229.  
  230. `CXXFLAGS'
  231.      Any flags to pass to the C++ compiler.
  232.  
  233. `CXXCOMPILE'
  234.      The command used to actually compile a C++ source file.  The file
  235.      name is appended to form the complete command line.
  236.  
  237. `CXXLINK'
  238.      The command used to actually link a C++ program.
  239.  
  240. 
  241. File: automake.info,  Node: Fortran 77 Support,  Next: Support for Other Languages,  Prev: C++ Support,  Up: Programs
  242.  
  243. Fortran 77 Support
  244. ==================
  245.  
  246.    Automake includes full support for Fortran 77.
  247.  
  248.    Any package including Fortran 77 code must define the output variable
  249. `F77' in `configure.in'; the simplest way to do this is to use the
  250. `AC_PROG_F77' macro (*note Particular Program Checks:
  251. (autoconf)Particular Programs.).  *Note Fortran 77 and Autoconf::.
  252.  
  253.    A few additional variables are defined when a Fortran 77 source file
  254. is seen:
  255.  
  256. `F77'
  257.      The name of the Fortran 77 compiler.
  258.  
  259. `FFLAGS'
  260.      Any flags to pass to the Fortran 77 compiler.
  261.  
  262. `RFLAGS'
  263.      Any flags to pass to the Ratfor compiler.
  264.  
  265. `F77COMPILE'
  266.      The command used to actually compile a Fortran 77 source file.
  267.      The file name is appended to form the complete command line.
  268.  
  269. `FLINK'
  270.      The command used to actually link a pure Fortran 77 program or
  271.      shared library.
  272.  
  273.    Automake can handle preprocessing Fortran 77 and Ratfor source files
  274. in addition to compiling them(1).  Automake also contains some support
  275. for creating programs and shared libraries that are a mixture of
  276. Fortran 77 and other languages (*note Mixing Fortran 77 With C and
  277. C++::.).
  278.  
  279.    These issues are covered in the following sections.
  280.  
  281. * Menu:
  282.  
  283. * Preprocessing Fortran 77::
  284. * Compiling Fortran 77 Files::
  285. * Mixing Fortran 77 With C and C++::
  286. * Fortran 77 and Autoconf::
  287.  
  288.    ---------- Footnotes ----------
  289.  
  290.    (1) Much, if not most, of the information in the following sections
  291. pertaining to preprocessing Fortran 77 programs was taken almost
  292. verbatim from *Note Catalogue of Rules: (make)Catalogue of Rules.
  293.  
  294. 
  295. File: automake.info,  Node: Preprocessing Fortran 77,  Next: Compiling Fortran 77 Files,  Prev: Fortran 77 Support,  Up: Fortran 77 Support
  296.  
  297. Preprocessing Fortran 77
  298. ------------------------
  299.  
  300.    `N.f' is made automatically from `N.F' or `N.r'.  This rule runs
  301. just the preprocessor to convert a preprocessable Fortran 77 or Ratfor
  302. source file into a strict Fortran 77 source file.  The precise command
  303. used is as follows:
  304.  
  305. `.F'
  306.      `$(F77) -F $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
  307.      $(AM_FFLAGS) $(FFLAGS)'
  308.  
  309. `.r'
  310.      `$(F77) -F $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)'
  311.  
  312. 
  313. File: automake.info,  Node: Compiling Fortran 77 Files,  Next: Mixing Fortran 77 With C and C++,  Prev: Preprocessing Fortran 77,  Up: Fortran 77 Support
  314.  
  315. Compiling Fortran 77 Files
  316. --------------------------
  317.  
  318.    `N.o' is made automatically from `N.f', `N.F' or `N.r' by running
  319. the Fortran 77 compiler.  The precise command used is as follows:
  320.  
  321. `.f'
  322.      `$(F77) -c $(AM_FFLAGS) $(FFLAGS)'
  323.  
  324. `.F'
  325.      `$(F77) -c $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
  326.      $(AM_FFLAGS) $(FFLAGS)'
  327.  
  328. `.r'
  329.      `$(F77) -c $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)'
  330.  
  331. 
  332. File: automake.info,  Node: Mixing Fortran 77 With C and C++,  Next: Fortran 77 and Autoconf,  Prev: Compiling Fortran 77 Files,  Up: Fortran 77 Support
  333.  
  334. Mixing Fortran 77 With C and C++
  335. --------------------------------
  336.  
  337.    Automake currently provides _limited_ support for creating programs
  338. and shared libraries that are a mixture of Fortran 77 and C and/or C++.
  339. However, there are many other issues related to mixing Fortran 77 with
  340. other languages that are _not_ (currently) handled by Automake, but
  341. that are handled by other packages(1).
  342.  
  343.    Automake can help in two ways:
  344.  
  345.   1. Automatic selection of the linker depending on which combinations
  346.      of source code.
  347.  
  348.   2. Automatic selection of the appropriate linker flags (e.g. `-L' and
  349.      `-l') to pass to the automatically selected linker in order to link
  350.      in the appropriate Fortran 77 intrinsic and run-time libraries.
  351.  
  352.      These extra Fortran 77 linker flags are supplied in the output
  353.      variable `FLIBS' by the `AC_F77_LIBRARY_LDFLAGS' Autoconf macro
  354.      supplied with newer versions of Autoconf (Autoconf version 2.13 and
  355.      later).  *Note Fortran 77 Compiler Characteristics:
  356.      (autoconf)Fortran 77 Compiler Characteristics.
  357.  
  358.    If Automake detects that a program or shared library (as mentioned in
  359. some `_PROGRAMS' or `_LTLIBRARIES' primary) contains source code that
  360. is a mixture of Fortran 77 and C and/or C++, then it requires that the
  361. macro `AC_F77_LIBRARY_LDFLAGS' be called in `configure.in', and that
  362. either `$(FLIBS)' or `@FLIBS@' appear in the appropriate `_LDADD' (for
  363. programs) or `_LIBADD' (for shared libraries) variables.  It is the
  364. responsibility of the person writing the `Makefile.am' to make sure
  365. that `$(FLIBS)' or `@FLIBS@' appears in the appropriate `_LDADD' or
  366. `_LIBADD' variable.
  367.  
  368.    For example, consider the following `Makefile.am':
  369.  
  370.      bin_PROGRAMS = foo
  371.      foo_SOURCES  = main.cc foo.f
  372.      foo_LDADD    = libfoo.la @FLIBS@
  373.      
  374.      pkglib_LTLIBRARIES = libfoo.la
  375.      libfoo_la_SOURCES  = bar.f baz.c zardoz.cc
  376.      libfoo_la_LIBADD   = $(FLIBS)
  377.  
  378.    In this case, Automake will insist that `AC_F77_LIBRARY_LDFLAGS' is
  379. mentioned in `configure.in'.  Also, if `@FLIBS@' hadn't been mentioned
  380. in `foo_LDADD' and `libfoo_la_LIBADD', then Automake would have issued
  381. a warning.
  382.  
  383. * Menu:
  384.  
  385. * How the Linker is Chosen::
  386.  
  387.    ---------- Footnotes ----------
  388.  
  389.    (1) For example, the cfortran package
  390. (http://www-zeus.desy.de/~burow/cfortran/) addresses all of these
  391. inter-language issues, and runs under nearly all Fortran 77, C and C++
  392. compilers on nearly all platforms.  However, `cfortran' is not yet Free
  393. Software, but it will be in the next major release.
  394.  
  395. 
  396. File: automake.info,  Node: How the Linker is Chosen,  Prev: Mixing Fortran 77 With C and C++,  Up: Mixing Fortran 77 With C and C++
  397.  
  398. How the Linker is Chosen
  399. ........................
  400.  
  401.    The following diagram demonstrates under what conditions a particular
  402. linker is chosen by Automake.
  403.  
  404.    For example, if Fortran 77, C and C++ source code were to be compiled
  405. into a program, then the C++ linker will be used.  In this case, if the
  406. C or Fortran 77 linkers required any special libraries that weren't
  407. included by the C++ linker, then they must be manually added to an
  408. `_LDADD' or `_LIBADD' variable by the user writing the `Makefile.am'.
  409.  
  410.                           \              Linker
  411.                source      \
  412.                 code        \     C        C++     Fortran
  413.           -----------------  +---------+---------+---------+
  414.                              |         |         |         |
  415.           C                  |    x    |         |         |
  416.                              |         |         |         |
  417.                              +---------+---------+---------+
  418.                              |         |         |         |
  419.               C++            |         |    x    |         |
  420.                              |         |         |         |
  421.                              +---------+---------+---------+
  422.                              |         |         |         |
  423.                     Fortran  |         |         |    x    |
  424.                              |         |         |         |
  425.                              +---------+---------+---------+
  426.                              |         |         |         |
  427.           C + C++            |         |    x    |         |
  428.                              |         |         |         |
  429.                              +---------+---------+---------+
  430.                              |         |         |         |
  431.           C +       Fortran  |         |         |    x    |
  432.                              |         |         |         |
  433.                              +---------+---------+---------+
  434.                              |         |         |         |
  435.               C++ + Fortran  |         |    x    |         |
  436.                              |         |         |         |
  437.                              +---------+---------+---------+
  438.                              |         |         |         |
  439.           C + C++ + Fortran  |         |    x    |         |
  440.                              |         |         |         |
  441.                              +---------+---------+---------+
  442.  
  443. 
  444. File: automake.info,  Node: Fortran 77 and Autoconf,  Prev: Mixing Fortran 77 With C and C++,  Up: Fortran 77 Support
  445.  
  446. Fortran 77 and Autoconf
  447. -----------------------
  448.  
  449.    The current Automake support for Fortran 77 requires a recent enough
  450. version Autoconf that also includes support for Fortran 77.  Full
  451. Fortran 77 support was added to Autoconf 2.13, so you will want to use
  452. that version of Autoconf or later.
  453.  
  454. 
  455. File: automake.info,  Node: Support for Other Languages,  Next: ANSI,  Prev: Fortran 77 Support,  Up: Programs
  456.  
  457. Support for Other Languages
  458. ===========================
  459.  
  460.    Automake currently only includes full support for C, C++ (*note C++
  461. Support::.)and Fortran 77 (*note Fortran 77 Support::.).  There is only
  462. rudimentary support for other languages, support for which will be
  463. improved based on user demand.
  464.  
  465. 
  466. File: automake.info,  Node: ANSI,  Next: Dependencies,  Prev: Support for Other Languages,  Up: Programs
  467.  
  468. Automatic de-ANSI-fication
  469. ==========================
  470.  
  471.    Although the GNU standards allow the use of ANSI C, this can have the
  472. effect of limiting portability of a package to some older compilers
  473. (notably SunOS).
  474.  
  475.    Automake allows you to work around this problem on such machines by
  476. "de-ANSI-fying" each source file before the actual compilation takes
  477. place.
  478.  
  479.    If the `Makefile.am' variable `AUTOMAKE_OPTIONS' (*note Options::.)
  480. contains the option `ansi2knr' then code to handle de-ANSI-fication is
  481. inserted into the generated `Makefile.in'.
  482.  
  483.    This causes each C source file in the directory to be treated as
  484. ANSI C.  If an ANSI C compiler is available, it is used.  If no ANSI C
  485. compiler is available, the `ansi2knr' program is used to convert the
  486. source files into K&R C, which is then compiled.
  487.  
  488.    The `ansi2knr' program is simple-minded.  It assumes the source code
  489. will be formatted in a particular way; see the `ansi2knr' man page for
  490. details.
  491.  
  492.    Support for de-ANSI-fication requires the source files `ansi2knr.c'
  493. and `ansi2knr.1' to be in the same package as the ANSI C source; these
  494. files are distributed with Automake.  Also, the package `configure.in'
  495. must call the macro `AM_C_PROTOTYPES' (*note Macros::.).
  496.  
  497.    Automake also handles finding the `ansi2knr' support files in some
  498. other directory in the current package.  This is done by prepending the
  499. relative path to the appropriate directory to the `ansi2knr' option.
  500. For instance, suppose the package has ANSI C code in the `src' and
  501. `lib' subdirs.  The files `ansi2knr.c' and `ansi2knr.1' appear in
  502. `lib'.  Then this could appear in `src/Makefile.am':
  503.  
  504.      AUTOMAKE_OPTIONS = ../lib/ansi2knr
  505.  
  506.    If no directory prefix is given, the files are assumed to be in the
  507. current directory.
  508.  
  509.    Files mentioned in `LIBOBJS' which need de-ANSI-fication will not be
  510. automatically handled.  That's because `configure' will generate an
  511. object name like `regex.o', while `make' will be looking for `regex_.o'
  512. (when de-ANSI-fying).  Eventually this problem will be fixed via
  513. `autoconf' magic, but for now you must put this code into your
  514. `configure.in', just before the `AC_OUTPUT' call:
  515.  
  516.      # This is necessary so that .o files in LIBOBJS are also built via
  517.      # the ANSI2KNR-filtering rules.
  518.      LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
  519.  
  520. 
  521. File: automake.info,  Node: Dependencies,  Prev: ANSI,  Up: Programs
  522.  
  523. Automatic dependency tracking
  524. =============================
  525.  
  526.    As a developer it is often painful to continually update the
  527. `Makefile.in' whenever the include-file dependencies change in a
  528. project.  Automake supplies a way to automatically track dependency
  529. changes, and distribute the dependencies in the generated `Makefile.in'.
  530.  
  531.    Currently this support requires the use of GNU `make' and `gcc'.  It
  532. might become possible in the future to supply a different dependency
  533. generating program, if there is enough demand.  In the meantime, this
  534. mode is enabled by default if any C program or library is defined in
  535. the current directory, so you may get a `Must be a separator' error
  536. from non-GNU make.
  537.  
  538.    When you decide to make a distribution, the `dist' target will
  539. re-run `automake' with `--include-deps' and other options.  *Note
  540. Invoking Automake::, and *Note Options::.  This will cause the
  541. previously generated dependencies to be inserted into the generated
  542. `Makefile.in', and thus into the distribution.  This step also turns
  543. off inclusion of the dependency generation code, so that those who
  544. download your distribution but don't use GNU `make' and `gcc' will not
  545. get errors.
  546.  
  547.    When added to the `Makefile.in', the dependencies have all
  548. system-specific dependencies automatically removed.  This can be done by
  549. listing the files in `OMIT_DEPENDENCIES'.  For instance all references
  550. to system header files are removed by Automake.  Sometimes it is useful
  551. to specify that a certain header file should be removed.  For instance
  552. if your `configure.in' uses `AM_WITH_REGEX', then any dependency on
  553. `rx.h' or `regex.h' should be removed, because the correct one cannot
  554. be known until the user configures the package.
  555.  
  556.    As it turns out, Automake is actually smart enough to handle the
  557. particular case of the regular expression header.  It will also
  558. automatically omit `libintl.h' if `AM_GNU_GETTEXT' is used.
  559.  
  560.    Automatic dependency tracking can be suppressed by putting
  561. `no-dependencies' in the variable `AUTOMAKE_OPTIONS'.
  562.  
  563.    If you unpack a distribution made by `make dist', and you want to
  564. turn on the dependency-tracking code again, simply re-run `automake'.
  565.  
  566.    The actual dependency files are put under the build directory, in a
  567. subdirectory named `.deps'.  These dependencies are machine specific.
  568. It is safe to delete them if you like; they will be automatically
  569. recreated during the next build.
  570.  
  571. 
  572. File: automake.info,  Node: Other objects,  Next: Other GNU Tools,  Prev: Programs,  Up: Top
  573.  
  574. Other Derived Objects
  575. *********************
  576.  
  577.    Automake can handle derived objects which are not C programs.
  578. Sometimes the support for actually building such objects must be
  579. explicitly supplied, but Automake will still automatically handle
  580. installation and distribution.
  581.  
  582. * Menu:
  583.  
  584. * Scripts::                     Executable scripts
  585. * Headers::                     Header files
  586. * Data::                        Architecture-independent data files
  587. * Sources::                     Derived sources
  588.  
  589. 
  590. File: automake.info,  Node: Scripts,  Next: Headers,  Prev: Other objects,  Up: Other objects
  591.  
  592. Executable Scripts
  593. ==================
  594.  
  595.    It is possible to define and install programs which are scripts.
  596. Such programs are listed using the `SCRIPTS' primary name.  Automake
  597. doesn't define any dependencies for scripts; the `Makefile.am' should
  598. include the appropriate rules.
  599.  
  600.    Automake does not assume that scripts are derived objects; such
  601. objects must be deleted by hand (*note Clean::.).
  602.  
  603.    The `automake' program itself is a Perl script that is generated at
  604. configure time from `automake.in'.  Here is how this is handled:
  605.  
  606.      bin_SCRIPTS = automake
  607.  
  608.    Since `automake' appears in the `AC_OUTPUT' macro, a target for it
  609. is automatically generated.
  610.  
  611.    Script objects can be installed in `bindir', `sbindir',
  612. `libexecdir', or `pkgdatadir'.
  613.  
  614. 
  615. File: automake.info,  Node: Headers,  Next: Data,  Prev: Scripts,  Up: Other objects
  616.  
  617. Header files
  618. ============
  619.  
  620.    Header files are specified by the `HEADERS' family of variables.
  621. Generally header files are not installed, so the `noinst_HEADERS'
  622. variable will be the most used.
  623.  
  624.    All header files must be listed somewhere; missing ones will not
  625. appear in the distribution.  Often it is clearest to list uninstalled
  626. headers with the rest of the sources for a program.  *Note A Program::.
  627. Headers listed in a `_SOURCES' variable need not be listed in any
  628. `_HEADERS' variable.
  629.  
  630.    Headers can be installed in `includedir', `oldincludedir', or
  631. `pkgincludedir'.
  632.  
  633. 
  634. File: automake.info,  Node: Data,  Next: Sources,  Prev: Headers,  Up: Other objects
  635.  
  636. Architecture-independent data files
  637. ===================================
  638.  
  639.    Automake supports the installation of miscellaneous data files using
  640. the `DATA' family of variables.
  641.  
  642.    Such data can be installed in the directories `datadir',
  643. `sysconfdir', `sharedstatedir', `localstatedir', or `pkgdatadir'.
  644.  
  645.    By default, data files are _not_ included in a distribution.
  646.  
  647.    Here is how Automake installs its auxiliary data files:
  648.  
  649.      pkgdata_DATA = clean-kr.am clean.am ...
  650.  
  651. 
  652. File: automake.info,  Node: Sources,  Prev: Data,  Up: Other objects
  653.  
  654. Built sources
  655. =============
  656.  
  657.    Occasionally a file which would otherwise be called `source' (e.g. a
  658. C `.h' file) is actually derived from some other file.  Such files
  659. should be listed in the `BUILT_SOURCES' variable.
  660.  
  661.    Built sources are also not compiled by default.  You must explicitly
  662. mention them in some other `_SOURCES' variable for this to happen.
  663.  
  664.    Note that, in some cases, `BUILT_SOURCES' will work in somewhat
  665. surprising ways.  In order to get the built sources to work with
  666. automatic dependency tracking, the `Makefile' must depend on
  667. `$(BUILT_SOURCES)'.  This can cause these sources to be rebuilt at what
  668. might seem like funny times.
  669.  
  670. 
  671. File: automake.info,  Node: Other GNU Tools,  Next: Documentation,  Prev: Other objects,  Up: Top
  672.  
  673. Other GNU Tools
  674. ***************
  675.  
  676.    Since Automake is primarily intended to generate `Makefile.in's for
  677. use in GNU programs, it tries hard to interoperate with other GNU tools.
  678.  
  679. * Menu:
  680.  
  681. * Emacs Lisp::                  Emacs Lisp
  682. * gettext::                     Gettext
  683. * Guile::                       Guile
  684. * Libtool::                     Libtool
  685. * Java::                        Java
  686.  
  687. 
  688. File: automake.info,  Node: Emacs Lisp,  Next: gettext,  Prev: Other GNU Tools,  Up: Other GNU Tools
  689.  
  690. Emacs Lisp
  691. ==========
  692.  
  693.    Automake provides some support for Emacs Lisp.  The `LISP' primary
  694. is used to hold a list of `.el' files.  Possible prefixes for this
  695. primary are `lisp_' and `noinst_'.  Note that if `lisp_LISP' is
  696. defined, then `configure.in' must run `AM_PATH_LISPDIR' (*note
  697. Macros::.).
  698.  
  699.    By default Automake will byte-compile all Emacs Lisp source files
  700. using the Emacs found by `AM_PATH_LISPDIR'.  If you wish to avoid
  701. byte-compiling, simply define the variable `ELCFILES' to be empty.
  702. Byte-compiled Emacs Lisp files are not portable among all versions of
  703. Emacs, so it makes sense to turn this off if you expect sites to have
  704. more than one version of Emacs installed.  Furthermore, many packages
  705. don't actually benefit from byte-compilation.  Still, we recommend that
  706. you leave it enabled by default.  It is probably better for sites with
  707. strange setups to cope for themselves than to make the installation less
  708. nice for everybody else.
  709.  
  710. 
  711. File: automake.info,  Node: gettext,  Next: Guile,  Prev: Emacs Lisp,  Up: Other GNU Tools
  712.  
  713. Gettext
  714. =======
  715.  
  716.    If `AM_GNU_GETTEXT' is seen in `configure.in', then Automake turns
  717. on support for GNU gettext, a message catalog system for
  718. internationalization (*note GNU Gettext: (gettext)GNU Gettext.).
  719.  
  720.    The `gettext' support in Automake requires the addition of two
  721. subdirectories to the package, `intl' and `po'.  Automake insures that
  722. these directories exist and are mentioned in `SUBDIRS'.
  723.  
  724.    Furthermore, Automake checks that the definition of `ALL_LINGUAS' in
  725. `configure.in' corresponds to all the valid `.po' files, and nothing
  726. more.
  727.  
  728. 
  729. File: automake.info,  Node: Guile,  Next: Libtool,  Prev: gettext,  Up: Other GNU Tools
  730.  
  731. Guile
  732. =====
  733.  
  734.    Automake provides some automatic support for writing Guile modules.
  735. Automake will turn on Guile support if the `AM_INIT_GUILE_MODULE' macro
  736. is used in `configure.in'.
  737.  
  738.    Right now Guile support just means that the `AM_INIT_GUILE_MODULE'
  739. macro is understood to mean:
  740.    * `AM_INIT_AUTOMAKE' is run.
  741.  
  742.    * `AC_CONFIG_AUX_DIR' is run, with a path of `..'.
  743.  
  744.    As the Guile module code matures, no doubt the Automake support will
  745. grow as well.
  746.  
  747. 
  748. File: automake.info,  Node: Libtool,  Next: Java,  Prev: Guile,  Up: Other GNU Tools
  749.  
  750. Libtool
  751. =======
  752.  
  753.    Automake provides support for GNU Libtool (*note Introduction:
  754. (libtool)Top.) with the `LTLIBRARIES' primary.  *Note A Shared
  755. Library::.
  756.  
  757. 
  758. File: automake.info,  Node: Java,  Prev: Libtool,  Up: Other GNU Tools
  759.  
  760. Java
  761. ====
  762.  
  763.    Automake provides some minimal support for Java compilation with the
  764. `JAVA' primary.
  765.  
  766.    Any `.java' files listed in a `_JAVA' variable will be compiled with
  767. `JAVAC' at build time.  By default, `.class' files are not included in
  768. the distribution.
  769.  
  770.    Currently Automake enforces the restriction that only one `_JAVA'
  771. primary can be used in a given `Makefile.am'.  The reason for this
  772. restriction is that, in general, it isn't possible to know which
  773. `.class' files were generated from which `.java' files - so it would be
  774. impossible to know which files to install where.
  775.  
  776. 
  777. File: automake.info,  Node: Documentation,  Next: Install,  Prev: Other GNU Tools,  Up: Top
  778.  
  779. Building documentation
  780. **********************
  781.  
  782.    Currently Automake provides support for Texinfo and man pages.
  783.  
  784. * Menu:
  785.  
  786. * Texinfo::                     Texinfo
  787. * Man pages::                   Man pages
  788.  
  789. 
  790. File: automake.info,  Node: Texinfo,  Next: Man pages,  Prev: Documentation,  Up: Documentation
  791.  
  792. Texinfo
  793. =======
  794.  
  795.    If the current directory contains Texinfo source, you must declare it
  796. with the `TEXINFOS' primary.  Generally Texinfo files are converted
  797. into info, and thus the `info_TEXINFOS' macro is most commonly used
  798. here.  Note that any Texinfo source file must end in the `.texi' or
  799. `.texinfo' extension.
  800.  
  801.    If the `.texi' file `@include's `version.texi', then that file will
  802. be automatically generated.  The file `version.texi' defines three
  803. Texinfo macros you can reference: `EDITION', `VERSION', and `UPDATED'.
  804. The first two hold the version number of your package (but are kept
  805. separate for clarity); the last is the date the primary file was last
  806. modified.  The `version.texi' support requires the `mdate-sh' program;
  807. this program is supplied with Automake and automatically included when
  808. `automake' is invoked with the `--add-missing' option.
  809.  
  810.    Sometimes an info file actually depends on more than one `.texi'
  811. file.  For instance, in GNU Hello, `hello.texi' includes the file
  812. `gpl.texi'.  You can tell Automake about these dependencies using the
  813. `TEXI_TEXINFOS' variable.  Here is how GNU Hello does it:
  814.  
  815.      info_TEXINFOS = hello.texi
  816.      hello_TEXINFOS = gpl.texi
  817.  
  818.    By default, Automake requires the file `texinfo.tex' to appear in
  819. the same directory as the Texinfo source.  However, if you used
  820. `AC_CONFIG_AUX_DIR' in `configure.in' (*note Finding `configure' Input:
  821. (autoconf)Input.), then `texinfo.tex' is looked for there.  Automake
  822. supplies `texinfo.tex' if `--add-missing' is given.
  823.  
  824.    If your package has Texinfo files in many directories, you can use
  825. the variable `TEXINFO_TEX' to tell Automake where to find the canonical
  826. `texinfo.tex' for your package.  The value of this variable should be
  827. the relative path from the current `Makefile.am' to `texinfo.tex':
  828.  
  829.      TEXINFO_TEX = ../doc/texinfo.tex
  830.  
  831.    The option `no-texinfo.tex' can be used to eliminate the requirement
  832. for `texinfo.tex'.  Use of the variable `TEXINFO_TEX' is preferable,
  833. however, because that allows the `dvi' target to still work.
  834.  
  835.    Automake generates an `install-info' target; some people apparently
  836. use this.  By default, info pages are installed by `make install'.
  837. This can be prevented via the `no-installinfo' option.
  838.  
  839. 
  840. File: automake.info,  Node: Man pages,  Prev: Texinfo,  Up: Documentation
  841.  
  842. Man pages
  843. =========
  844.  
  845.    A package can also include man pages (but see the GNU standards on
  846. this matter, *Note Man Pages: (standards)Man Pages.)  Man pages are
  847. declared using the `MANS' primary.  Generally the `man_MANS' macro is
  848. used.  Man pages are automatically installed in the correct
  849. subdirectory of `mandir', based on the file extension.  They are not
  850. automatically included in the distribution.
  851.  
  852.    By default, man pages are installed by `make install'.  However,
  853. since the GNU project does not require man pages, many maintainers do
  854. not expend effort to keep the man pages up to date.  In these cases, the
  855. `no-installman' option will prevent the man pages from being installed
  856. by default.  The user can still explicitly install them via `make
  857. install-man'.
  858.  
  859.    Here is how the documentation is handled in GNU `cpio' (which
  860. includes both Texinfo documentation and man pages):
  861.  
  862.      info_TEXINFOS = cpio.texi
  863.      man_MANS = cpio.1 mt.1
  864.      EXTRA_DIST = $(man_MANS)
  865.  
  866.    Texinfo source and info pages are all considered to be source for the
  867. purposes of making a distribution.
  868.  
  869.    Man pages are not currently considered to be source, because it is
  870. not uncommon for man pages to be automatically generated.  For the same
  871. reason, they are not automatically included in the distribution.
  872.  
  873. 
  874. File: automake.info,  Node: Install,  Next: Clean,  Prev: Documentation,  Up: Top
  875.  
  876. What Gets Installed
  877. *******************
  878.  
  879.    Naturally, Automake handles the details of actually installing your
  880. program once it has been built.  All `PROGRAMS', `SCRIPTS',
  881. `LIBRARIES', `LISP', `DATA' and `HEADERS' are automatically installed
  882. in the appropriate places.
  883.  
  884.    Automake also handles installing any specified info and man pages.
  885.  
  886.    Automake generates separate `install-data' and `install-exec'
  887. targets, in case the installer is installing on multiple machines which
  888. share directory structure--these targets allow the machine-independent
  889. parts to be installed only once.  The `install' target depends on both
  890. of these targets.
  891.  
  892.    Automake also generates an `uninstall' target, an `installdirs'
  893. target, and an `install-strip' target.
  894.  
  895.    It is possible to extend this mechanism by defining an
  896. `install-exec-local' or `install-data-local' target.  If these targets
  897. exist, they will be run at `make install' time.
  898.  
  899.    Variables using the standard directory prefixes `data', `info',
  900. `man', `include', `oldinclude', `pkgdata', or `pkginclude' (e.g.
  901. `data_DATA') are installed by `install-data'.
  902.  
  903.    Variables using the standard directory prefixes `bin', `sbin',
  904. `libexec', `sysconf', `localstate', `lib', or `pkglib' (e.g.
  905. `bin_PROGRAMS') are installed by `install-exec'.
  906.  
  907.    Any variable using a user-defined directory prefix with `exec' in
  908. the name (e.g. `myexecbin_PROGRAMS' is installed by `install-exec'.
  909. All other user-defined prefixes are installed by `install-data'.
  910.  
  911.    Automake generates support for the `DESTDIR' variable in all install
  912. rules.  `DESTDIR' is used during the `make install' step to relocate
  913. install objects into a staging area.  Each object and path is prefixed
  914. with the value of `DESTDIR' before being copied into the install area.
  915. Here is an example of typical DESTDIR usage:
  916.  
  917.      make DESTDIR=/tmp/staging install
  918.  
  919.    This places install objects in a directory tree built under
  920. `/tmp/staging'.  If `/gnu/bin/foo' and `/gnu/share/aclocal/foo.m4' are
  921. to be installed, the above command would install
  922. `/tmp/staging/gnu/bin/foo' and `/tmp/staging/gnu/share/aclocal/foo.m4'.
  923.  
  924.    This feature is commonly used to build install images and packages.
  925. For more information, see *Note Makefile Conventions:
  926. (standards)Makefile Conventions.
  927.  
  928. 
  929. File: automake.info,  Node: Clean,  Next: Dist,  Prev: Install,  Up: Top
  930.  
  931. What Gets Cleaned
  932. *****************
  933.  
  934.    The GNU Makefile Standards specify a number of different clean rules.
  935. Generally the files that can be cleaned are determined automatically by
  936. Automake.  Of course, Automake also recognizes some variables that can
  937. be defined to specify additional files to clean.  These variables are
  938. `MOSTLYCLEANFILES', `CLEANFILES', `DISTCLEANFILES', and
  939. `MAINTAINERCLEANFILES'.
  940.  
  941. 
  942. File: automake.info,  Node: Dist,  Next: Tests,  Prev: Clean,  Up: Top
  943.  
  944. What Goes in a Distribution
  945. ***************************
  946.  
  947.    The `dist' target in the generated `Makefile.in' can be used to
  948. generate a gzip'd `tar' file for distribution.  The tar file is named
  949. based on the `PACKAGE' and `VERSION' variables; more precisely it is
  950. named `PACKAGE-VERSION.tar.gz'.  You can use the `make' variable
  951. `GZIP_ENV' to control how gzip is run.  The default setting is `--best'.
  952.  
  953.    For the most part, the files to distribute are automatically found by
  954. Automake: all source files are automatically included in a distribution,
  955. as are all `Makefile.am's and `Makefile.in's.  Automake also has a
  956. built-in list of commonly used files which, if present in the current
  957. directory, are automatically included.  This list is printed by
  958. `automake --help'.  Also, files which are read by `configure' (i.e. the
  959. source files corresponding to the files specified in the `AC_OUTPUT'
  960. invocation) are automatically distributed.
  961.  
  962.    Still, sometimes there are files which must be distributed, but which
  963. are not covered in the automatic rules.  These files should be listed in
  964. the `EXTRA_DIST' variable.  You can mention files from subdirectories
  965. in `EXTRA_DIST'.  You can also mention a directory there; in this case
  966. the entire directory will be recursively copied into the distribution.
  967.  
  968.    If you define `SUBDIRS', Automake will recursively include the
  969. subdirectories in the distribution.  If `SUBDIRS' is defined
  970. conditionally (*note Conditionals::.), Automake will normally include
  971. all directories that could possibly appear in `SUBDIRS' in the
  972. distribution.  If you need to specify the set of directories
  973. conditionally, you can set the variable `DIST_SUBDIRS' to the exact
  974. list of subdirectories to include in the distribution.
  975.  
  976.    Occasionally it is useful to be able to change the distribution
  977. before it is packaged up.  If the `dist-hook' target exists, it is run
  978. after the distribution directory is filled, but before the actual tar
  979. (or shar) file is created.  One way to use this is for distributing
  980. files in subdirectories for which a new `Makefile.am' is overkill:
  981.  
  982.      dist-hook:
  983.              mkdir $(distdir)/random
  984.              cp -p $(srcdir)/random/a1 $(srcdir)/random/a2 $(distdir)/random
  985.  
  986.    Automake also generates a `distcheck' target which can be help to
  987. ensure that a given distribution will actually work.  `distcheck' makes
  988. a distribution, and then tries to do a `VPATH' build.
  989.  
  990. 
  991. File: automake.info,  Node: Tests,  Next: Options,  Prev: Dist,  Up: Top
  992.  
  993. Support for test suites
  994. ***********************
  995.  
  996.    Automake supports two forms of test suites.
  997.  
  998.    If the variable `TESTS' is defined, its value is taken to be a list
  999. of programs to run in order to do the testing.  The programs can either
  1000. be derived objects or source objects; the generated rule will look both
  1001. in `srcdir' and `.'.  Programs needing data files should look for them
  1002. in `srcdir' (which is both an environment variable and a make variable)
  1003. so they work when building in a separate directory (*note Build
  1004. Directories: (autoconf)Build Directories.), and in particular for the
  1005. `distcheck' target (*note Dist::.).
  1006.  
  1007.    The number of failures will be printed at the end of the run.  If a
  1008. given test program exits with a status of 77, then its result is ignored
  1009. in the final count.  This feature allows non-portable tests to be
  1010. ignored in environments where they don't make sense.
  1011.  
  1012.    The variable `TESTS_ENVIRONMENT' can be used to set environment
  1013. variables for the test run; the environment variable `srcdir' is set in
  1014. the rule.  If all your test programs are scripts, you can also set
  1015. `TESTS_ENVIRONMENT' to an invocation of the shell (e.g.  `$(SHELL)
  1016. -x'); this can be useful for debugging the tests.
  1017.  
  1018.    If `dejagnu' (ftp://prep.ai.mit.edu/pub/gnu/dejagnu-1.3.tar.gz)
  1019. appears in `AUTOMAKE_OPTIONS', then a `dejagnu'-based test suite is
  1020. assumed.  The value of the variable `DEJATOOL' is passed as the
  1021. `--tool' argument to `runtest'; it defaults to the name of the package.
  1022.  
  1023.    The variable `RUNTESTDEFAULTFLAGS' holds the `--tool' and `--srcdir'
  1024. flags that are passed to dejagnu by default; this can be overridden if
  1025. necessary.
  1026.  
  1027.    The variables `EXPECT', `RUNTEST' and `RUNTESTFLAGS' can also be
  1028. overridden to provide project-specific values.  For instance, you will
  1029. need to do this if you are testing a compiler toolchain, because the
  1030. default values do not take into account host and target names.
  1031.  
  1032.    In either case, the testing is done via `make check'.
  1033.  
  1034. 
  1035. File: automake.info,  Node: Options,  Next: Miscellaneous,  Prev: Tests,  Up: Top
  1036.  
  1037. Changing Automake's Behavior
  1038. ****************************
  1039.  
  1040.    Various features of Automake can be controlled by options in the
  1041. `Makefile.am'.  Such options are listed in a special variable named
  1042. `AUTOMAKE_OPTIONS'.  Currently understood options are:
  1043.  
  1044. `gnits'
  1045. `gnu'
  1046. `foreign'
  1047.  
  1048. `cygnus'
  1049.      Set the strictness as appropriate.  The `gnits' option also implies
  1050.      `readme-alpha' and `check-news'.
  1051.  
  1052. `ansi2knr'
  1053. `path/ansi2knr'
  1054.      Turn on automatic de-ANSI-fication.  *Note ANSI::.  If preceded by
  1055.      a path, the generated `Makefile.in' will look in the specified
  1056.      directory to find the `ansi2knr' program.  Generally the path
  1057.      should be a relative path to another directory in the same
  1058.      distribution (though Automake currently does not check this).
  1059.  
  1060. `check-news'
  1061.      Cause `make dist' to fail unless the current version number appears
  1062.      in the first few lines of the `NEWS' file.
  1063.  
  1064. `dejagnu'
  1065.      Cause `dejagnu'-specific rules to be generated.  *Note Tests::.
  1066.  
  1067. `dist-shar'
  1068.      Generate a `dist-shar' target as well as the ordinary `dist'
  1069.      target.  This new target will create a shar archive of the
  1070.      distribution.
  1071.  
  1072. `dist-zip'
  1073.      Generate a `dist-zip' target as well as the ordinary `dist'
  1074.      target.  This new target will create a zip archive of the
  1075.      distribution.
  1076.  
  1077. `dist-tarZ'
  1078.      Generate a `dist-tarZ' target as well as the ordinary `dist'
  1079.      target.  This new target will create a compressed tar archive of
  1080.      the distribution; a traditional `tar' and `compress' will be
  1081.      assumed.  Warning: if you are actually using `GNU tar', then the
  1082.      generated archive might contain nonportable constructs.
  1083.  
  1084. `no-dependencies'
  1085.      This is similar to using `--include-deps' on the command line, but
  1086.      is useful for those situations where you don't have the necessary
  1087.      bits to make automatic dependency tracking work *Note
  1088.      Dependencies::.  In this case the effect is to effectively disable
  1089.      automatic dependency tracking.
  1090.  
  1091. `no-installinfo'
  1092.      The generated `Makefile.in' will not cause info pages to be built
  1093.      or installed by default.  However, `info' and `install-info'
  1094.      targets will still be available.  This option is disallowed at
  1095.      `GNU' strictness and above.
  1096.  
  1097. `no-installman'
  1098.      The generated `Makefile.in' will not cause man pages to be
  1099.      installed by default.  However, an `install-man' target will still
  1100.      be available for optional installation.  This option is disallowed
  1101.      at `GNU' strictness and above.
  1102.  
  1103. `no-texinfo.tex'
  1104.      Don't require `texinfo.tex', even if there are texinfo files in
  1105.      this directory.
  1106.  
  1107. `readme-alpha'
  1108.      If this release is an alpha release, and the file `README-alpha'
  1109.      exists, then it will be added to the distribution.  If this option
  1110.      is given, version numbers are expected to follow one of two forms.
  1111.      The first form is `MAJOR.MINOR.ALPHA', where each element is a
  1112.      number; the final period and number should be left off for
  1113.      non-alpha releases.  The second form is `MAJOR.MINORALPHA', where
  1114.      ALPHA is a letter; it should be omitted for non-alpha releases.
  1115.  
  1116. VERSION
  1117.      A version number (e.g. `0.30') can be specified.  If Automake is
  1118.      not newer than the version specified, creation of the `Makefile.in'
  1119.      will be suppressed.
  1120.  
  1121.    Unrecognized options are diagnosed by `automake'.
  1122.  
  1123. 
  1124. File: automake.info,  Node: Miscellaneous,  Next: Include,  Prev: Options,  Up: Top
  1125.  
  1126. Miscellaneous Rules
  1127. *******************
  1128.  
  1129.    There are a few rules and variables that didn't fit anywhere else.
  1130.  
  1131. * Menu:
  1132.  
  1133. * Tags::                        Interfacing to etags and mkid
  1134. * Suffixes::                    Handling new file extensions
  1135.  
  1136. 
  1137. File: automake.info,  Node: Tags,  Next: Suffixes,  Prev: Miscellaneous,  Up: Miscellaneous
  1138.  
  1139. Interfacing to `etags'
  1140. ======================
  1141.  
  1142.    Automake will generate rules to generate `TAGS' files for use with
  1143. GNU Emacs under some circumstances.
  1144.  
  1145.    If any C, C++ or Fortran 77 source code or headers are present, then
  1146. `tags' and `TAGS' targets will be generated for the directory.
  1147.  
  1148.    At the topmost directory of a multi-directory package, a `tags'
  1149. target file will be generated which, when run, will generate a `TAGS'
  1150. file that includes by reference all `TAGS' files from subdirectories.
  1151.  
  1152.    Also, if the variable `ETAGS_ARGS' is defined, a `tags' target will
  1153. be generated.  This variable is intended for use in directories which
  1154. contain taggable source that `etags' does not understand.
  1155.  
  1156.    Here is how Automake generates tags for its source, and for nodes in
  1157. its Texinfo file:
  1158.  
  1159.      ETAGS_ARGS = automake.in --lang=none \
  1160.       --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
  1161.  
  1162.    If you add filenames to `ETAGS_ARGS', you will probably also want to
  1163. set `TAGS_DEPENDENCIES'.  The contents of this variable are added
  1164. directly to the dependencies for the `tags' target.
  1165.  
  1166.    Automake will also generate an `ID' target which will run `mkid' on
  1167. the source.  This is only supported on a directory-by-directory basis.
  1168.  
  1169. 
  1170. File: automake.info,  Node: Suffixes,  Prev: Tags,  Up: Miscellaneous
  1171.  
  1172. Handling new file extensions
  1173. ============================
  1174.  
  1175.    It is sometimes useful to introduce a new implicit rule to handle a
  1176. file type that Automake does not know about.  If this is done, you must
  1177. notify GNU Make of the new suffixes.  This can be done by putting a list
  1178. of new suffixes in the `SUFFIXES' variable.
  1179.  
  1180.    For instance, currently Automake does not provide any Java support.
  1181. If you wrote a macro to generate `.class' files from `.java' source
  1182. files, you would also need to add these suffixes to the list:
  1183.  
  1184.      SUFFIXES = .java .class
  1185.  
  1186. 
  1187. File: automake.info,  Node: Include,  Next: Conditionals,  Prev: Miscellaneous,  Up: Top
  1188.  
  1189. Include
  1190. *******
  1191.  
  1192.    To include another file (perhaps for common rules), the following
  1193. syntax is supported:
  1194.  
  1195.    include ($(srcdir)|$(top_srcdir))/filename
  1196.  
  1197.    Using files in the current directory:
  1198.      include $(srcdir)/Makefile.extra
  1199.  
  1200.      include Makefile.generated
  1201.  
  1202.    Using a file in the top level directory:
  1203.      include $(top_srcdir)/filename
  1204.  
  1205. 
  1206. File: automake.info,  Node: Conditionals,  Next: Gnits,  Prev: Include,  Up: Top
  1207.  
  1208. Conditionals
  1209. ************
  1210.  
  1211.    Automake supports a simple type of conditionals.
  1212.  
  1213.    Before using a conditional, you must define it by using
  1214. `AM_CONDITIONAL' in the `configure.in' file (*note Macros::.).  The
  1215. `AM_CONDITIONAL' macro takes two arguments.
  1216.  
  1217.    The first argument to `AM_CONDITIONAL' is the name of the
  1218. conditional.  This should be a simple string starting with a letter and
  1219. containing only letters, digits, and underscores.
  1220.  
  1221.    The second argument to `AM_CONDITIONAL' is a shell condition,
  1222. suitable for use in a shell `if' statement.  The condition is evaluated
  1223. when `configure' is run.
  1224.  
  1225.    Conditionals typically depend upon options which the user provides to
  1226. the `configure' script.  Here is an example of how to write a
  1227. conditional which is true if the user uses the `--enable-debug' option.
  1228.  
  1229.      AC_ARG_ENABLE(debug,
  1230.      [  --enable-debug    Turn on debugging],
  1231.      [case "${enableval}" in
  1232.        yes) debug=true ;;
  1233.        no)  debug=false ;;
  1234.        *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
  1235.      esac],[debug=false])
  1236.      AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
  1237.  
  1238.    Here is an example of how to use that conditional in `Makefile.am':
  1239.  
  1240.      if DEBUG
  1241.      DBG = debug
  1242.      else
  1243.      DBG =
  1244.      endif
  1245.      noinst_PROGRAMS = $(DBG)
  1246.  
  1247.    This trivial example could also be handled using EXTRA_PROGRAMS
  1248. (*note A Program::.).
  1249.  
  1250.    You may only test a single variable in an `if' statement.  The
  1251. `else' statement may be omitted.  Conditionals may be nested to any
  1252. depth.
  1253.  
  1254.    Note that conditionals in Automake are not the same as conditionals
  1255. in GNU Make.  Automake conditionals are checked at configure time by the
  1256. `configure' script, and affect the translation from `Makefile.in' to
  1257. `Makefile'.  They are based on options passed to `configure' and on
  1258. results that `configure' has discovered about the host system.  GNU
  1259. Make conditionals are checked at `make' time, and are based on
  1260. variables passed to the make program or defined in the `Makefile'.
  1261.  
  1262.    Automake conditionals will work with any make program.
  1263.  
  1264.